﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using GameStateManagement.GameHelper;
namespace _0812367_0912581
{
    class GameLevel2: GameLevel
    {
        public GameLevel2(Game game, SpriteBatch theSpriteBatch)
            : base(game, theSpriteBatch)
        {
            
        }
        public override void  LoadContent(ContentManager theContent)
        {
            
 	        base.LoadContent(theContent);
            this.playerMoney = PLAYERMONEY_BEGIN + 100;
            //Player 
            //this.playerMoney = this.PLAYERMONEY_BEGIN + 200;
            this.nPlayerSprite = 5;
            playerSprite = new PlayerSprite[nPlayerSprite];
            listPlayerSpriteDraw = new List<PlayerSprite>();
            this.dx = Game.Window.ClientBounds.Width / 2 - 400;
            this.dy = 0;

            //public Plants(Texture2D aImage, Point aSheetsize, Vector2 thePosition, int theColOffset, float scale, int timePerFrame, int theTimeFireDelay, bool isLiving, Texture2D aBulletTexture, int theHp, bool AllowFire)
            playerSprite[0] = new PlayerSprite(playerTexture[0], new Point(4, 1), new Vector2(dx, dy), 20, 0.7f, 400, 600, true, playerBulletTexture[0], 200, true);
            dx += playerSprite[0].FrameSize.X * playerSprite[0].Scale;
            playerSprite[1] = new PlayerSprite(playerTexture[1], new Point(6, 1), new Vector2(dx, dy), 20, 0.7f, 200, 600, true, playerBulletTexture[0], 200, true);
            dx += playerSprite[1].FrameSize.X * playerSprite[1].Scale;
            playerSprite[2] = new PlayerSprite(playerTexture[2], new Point(6, 8), new Vector2(dx, dy), 20, 0.8f, 20, 600, true, playerBulletTexture[0], 200, true);
            dx += playerSprite[2].FrameSize.X * playerSprite[2].Scale;
            playerSprite[3] = new PlayerSprite(playerTexture[3], new Point(1, 1), new Vector2(dx, dy), 20, 0.65f, 20, 600, true, playerBulletTexture[0], 200, true);
            dx += playerSprite[3].FrameSize.X * playerSprite[3].Scale;
            playerSprite[4] = new PlayerSprite(playerTexture[8], new Point(3, 1), new Vector2(dx, dy), 20, 0.7f, 200, 600, true, playerBulletTexture[0], 200, false); 
            

            //Monter
            this.nMonterSprite = 4;
            this.TOTALMONTER = 50;
            this.remainMonterSprite = TOTALMONTER;
            this.NUMBER_MONTER_BEGIN = 6;
            this.numberMonterSpriteAtTime = this.NUMBER_MONTER_BEGIN;//se dc Update
            this.curNumberMonter = 0;
            this.monterSprite = new EnemySprite[nMonterSprite];
            this.listMonterSprite = new List<EnemySprite>();

            // public Monter(Texture2D aImage, Point aSheetsize, Vector2 thePosition, int theColOffset, float scale, int timePerFrame, Vector2 theSpeed, bool isLiving, Texture2D aBulletTexture, int theHp, bool AllowFire, int TimeFireDelay)
            monterSprite[0] = new EnemySprite(monterTexture[0], new Point(6, 1), new Vector2(Game.Window.ClientBounds.Width - 50, 50), 20, 1.0f, 50, new Vector2(1, 0), true, monterBulletTexture[0], 160, true, 800);
            monterSprite[1] = new EnemySprite(monterTexture[1], new Point(4, 1), new Vector2(Game.Window.ClientBounds.Width - 50, 150), 20, 1.0f, 200, new Vector2(1, 0), true, monterBulletTexture[0], 160, true, 800);
            monterSprite[2] = new EnemySprite(monterTexture[2], new Point(6, 8), new Vector2(Game.Window.ClientBounds.Width - 50, 250), 20, 1.2f, 200, new Vector2(2, 0), true, monterBulletTexture[0], 160, false, 800);
            monterSprite[3] = new EnemySprite(monterTexture[3], new Point(3, 1), new Vector2(Game.Window.ClientBounds.Width - 50, 350), 20, 1.0f, 300, new Vector2(1, 0), true, monterBulletTexture[0], 160, true, 800);
             
        }
    }
}
